Optimal. Leaf size=105 \[ -\frac {(a-b)^2 \log (\cos (e+f x))}{f}-\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(a-b)^2 \tan ^4(e+f x)}{4 f}+\frac {(2 a-b) b \tan ^6(e+f x)}{6 f}+\frac {b^2 \tan ^8(e+f x)}{8 f} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.08, antiderivative size = 105, normalized size of antiderivative = 1.00, number of steps
used = 4, number of rules used = 3, integrand size = 23, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.130, Rules used = {3751, 457, 90}
\begin {gather*} \frac {b (2 a-b) \tan ^6(e+f x)}{6 f}+\frac {(a-b)^2 \tan ^4(e+f x)}{4 f}-\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}-\frac {(a-b)^2 \log (\cos (e+f x))}{f}+\frac {b^2 \tan ^8(e+f x)}{8 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 90
Rule 457
Rule 3751
Rubi steps
\begin {align*} \int \tan ^5(e+f x) \left (a+b \tan ^2(e+f x)\right )^2 \, dx &=\frac {\text {Subst}\left (\int \frac {x^5 \left (a+b x^2\right )^2}{1+x^2} \, dx,x,\tan (e+f x)\right )}{f}\\ &=\frac {\text {Subst}\left (\int \frac {x^2 (a+b x)^2}{1+x} \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=\frac {\text {Subst}\left (\int \left (-(a-b)^2+(a-b)^2 x+(2 a-b) b x^2+b^2 x^3+\frac {(a-b)^2}{1+x}\right ) \, dx,x,\tan ^2(e+f x)\right )}{2 f}\\ &=-\frac {(a-b)^2 \log (\cos (e+f x))}{f}-\frac {(a-b)^2 \tan ^2(e+f x)}{2 f}+\frac {(a-b)^2 \tan ^4(e+f x)}{4 f}+\frac {(2 a-b) b \tan ^6(e+f x)}{6 f}+\frac {b^2 \tan ^8(e+f x)}{8 f}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.24, size = 89, normalized size = 0.85 \begin {gather*} \frac {-24 (a-b)^2 \log (\cos (e+f x))-12 (a-b)^2 \tan ^2(e+f x)+6 (a-b)^2 \tan ^4(e+f x)+4 (2 a-b) b \tan ^6(e+f x)+3 b^2 \tan ^8(e+f x)}{24 f} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.10, size = 143, normalized size = 1.36
method | result | size |
norman | \(\frac {b^{2} \left (\tan ^{8}\left (f x +e \right )\right )}{8 f}-\frac {\left (a^{2}-2 a b +b^{2}\right ) \left (\tan ^{2}\left (f x +e \right )\right )}{2 f}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \left (\tan ^{4}\left (f x +e \right )\right )}{4 f}+\frac {\left (2 a -b \right ) b \left (\tan ^{6}\left (f x +e \right )\right )}{6 f}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2 f}\) | \(114\) |
derivativedivides | \(\frac {\frac {b^{2} \left (\tan ^{8}\left (f x +e \right )\right )}{8}+\frac {a b \left (\tan ^{6}\left (f x +e \right )\right )}{3}-\frac {b^{2} \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {a^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {a b \left (\tan ^{4}\left (f x +e \right )\right )}{2}+\frac {b^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {a^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+a b \left (\tan ^{2}\left (f x +e \right )\right )-\frac {b^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}}{f}\) | \(143\) |
default | \(\frac {\frac {b^{2} \left (\tan ^{8}\left (f x +e \right )\right )}{8}+\frac {a b \left (\tan ^{6}\left (f x +e \right )\right )}{3}-\frac {b^{2} \left (\tan ^{6}\left (f x +e \right )\right )}{6}+\frac {a^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {a b \left (\tan ^{4}\left (f x +e \right )\right )}{2}+\frac {b^{2} \left (\tan ^{4}\left (f x +e \right )\right )}{4}-\frac {a^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+a b \left (\tan ^{2}\left (f x +e \right )\right )-\frac {b^{2} \left (\tan ^{2}\left (f x +e \right )\right )}{2}+\frac {\left (a^{2}-2 a b +b^{2}\right ) \ln \left (1+\tan ^{2}\left (f x +e \right )\right )}{2}}{f}\) | \(143\) |
risch | \(i a^{2} x -2 i a b x +i b^{2} x +\frac {2 i a^{2} e}{f}-\frac {4 i a b e}{f}+\frac {2 i b^{2} e}{f}-\frac {4 \left (3 a^{2} {\mathrm e}^{14 i \left (f x +e \right )}-9 a b \,{\mathrm e}^{14 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{14 i \left (f x +e \right )}+15 a^{2} {\mathrm e}^{12 i \left (f x +e \right )}-36 a b \,{\mathrm e}^{12 i \left (f x +e \right )}+18 b^{2} {\mathrm e}^{12 i \left (f x +e \right )}+33 a^{2} {\mathrm e}^{10 i \left (f x +e \right )}-79 a b \,{\mathrm e}^{10 i \left (f x +e \right )}+50 b^{2} {\mathrm e}^{10 i \left (f x +e \right )}+42 a^{2} {\mathrm e}^{8 i \left (f x +e \right )}-104 a b \,{\mathrm e}^{8 i \left (f x +e \right )}+52 b^{2} {\mathrm e}^{8 i \left (f x +e \right )}+33 a^{2} {\mathrm e}^{6 i \left (f x +e \right )}-79 a b \,{\mathrm e}^{6 i \left (f x +e \right )}+50 b^{2} {\mathrm e}^{6 i \left (f x +e \right )}+15 a^{2} {\mathrm e}^{4 i \left (f x +e \right )}-36 a b \,{\mathrm e}^{4 i \left (f x +e \right )}+18 b^{2} {\mathrm e}^{4 i \left (f x +e \right )}+3 a^{2} {\mathrm e}^{2 i \left (f x +e \right )}-9 a b \,{\mathrm e}^{2 i \left (f x +e \right )}+6 b^{2} {\mathrm e}^{2 i \left (f x +e \right )}\right )}{3 f \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right )^{8}}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a^{2}}{f}+\frac {2 \ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) a b}{f}-\frac {\ln \left ({\mathrm e}^{2 i \left (f x +e \right )}+1\right ) b^{2}}{f}\) | \(416\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.29, size = 170, normalized size = 1.62 \begin {gather*} -\frac {12 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\sin \left (f x + e\right )^{2} - 1\right ) - \frac {24 \, {\left (a^{2} - 3 \, a b + 2 \, b^{2}\right )} \sin \left (f x + e\right )^{6} - 6 \, {\left (11 \, a^{2} - 30 \, a b + 18 \, b^{2}\right )} \sin \left (f x + e\right )^{4} + 4 \, {\left (15 \, a^{2} - 38 \, a b + 22 \, b^{2}\right )} \sin \left (f x + e\right )^{2} - 18 \, a^{2} + 44 \, a b - 25 \, b^{2}}{\sin \left (f x + e\right )^{8} - 4 \, \sin \left (f x + e\right )^{6} + 6 \, \sin \left (f x + e\right )^{4} - 4 \, \sin \left (f x + e\right )^{2} + 1}}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.97, size = 112, normalized size = 1.07 \begin {gather*} \frac {3 \, b^{2} \tan \left (f x + e\right )^{8} + 4 \, {\left (2 \, a b - b^{2}\right )} \tan \left (f x + e\right )^{6} + 6 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{4} - 12 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \tan \left (f x + e\right )^{2} - 12 \, {\left (a^{2} - 2 \, a b + b^{2}\right )} \log \left (\frac {1}{\tan \left (f x + e\right )^{2} + 1}\right )}{24 \, f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 206 vs.
\(2 (82) = 164\).
time = 0.27, size = 206, normalized size = 1.96 \begin {gather*} \begin {cases} \frac {a^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {a^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {a^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} - \frac {a b \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{f} + \frac {a b \tan ^{6}{\left (e + f x \right )}}{3 f} - \frac {a b \tan ^{4}{\left (e + f x \right )}}{2 f} + \frac {a b \tan ^{2}{\left (e + f x \right )}}{f} + \frac {b^{2} \log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 f} + \frac {b^{2} \tan ^{8}{\left (e + f x \right )}}{8 f} - \frac {b^{2} \tan ^{6}{\left (e + f x \right )}}{6 f} + \frac {b^{2} \tan ^{4}{\left (e + f x \right )}}{4 f} - \frac {b^{2} \tan ^{2}{\left (e + f x \right )}}{2 f} & \text {for}\: f \neq 0 \\x \left (a + b \tan ^{2}{\left (e \right )}\right )^{2} \tan ^{5}{\left (e \right )} & \text {otherwise} \end {cases} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 3813 vs.
\(2 (102) = 204\).
time = 10.39, size = 3813, normalized size = 36.31 \begin {gather*} \text {Too large to display} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 11.59, size = 113, normalized size = 1.08 \begin {gather*} \frac {\ln \left ({\mathrm {tan}\left (e+f\,x\right )}^2+1\right )\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^6\,\left (\frac {a\,b}{3}-\frac {b^2}{6}\right )+\frac {b^2\,{\mathrm {tan}\left (e+f\,x\right )}^8}{8}-{\mathrm {tan}\left (e+f\,x\right )}^2\,\left (\frac {a^2}{2}-a\,b+\frac {b^2}{2}\right )+{\mathrm {tan}\left (e+f\,x\right )}^4\,\left (\frac {a^2}{4}-\frac {a\,b}{2}+\frac {b^2}{4}\right )}{f} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________